1. Technical Field:
The present invention relates generally to an improved data processing system, and in particular to a method and apparatus for processing graphics data. Still more particularly, the present invention relates generally to a method and apparatus for performing graphics perspective transformations on graphics data.
2. Description of Related Art:
Data processing systems, such as personal computers and work stations, are commonly utilized to run computer-aided design (CAD) applications, computer-aided manufacturing (CAM) applications, and computer-aided software engineering (CASE) tools. Engineers, scientists, technicians, and others employ these applications daily. These applications involve complex calculations, such as finite element analysis, to model stress in structures. Other applications include chemical or molecular modeling applications. CAD/CAM/CASE applications are normally graphics intensive in terms of the information relayed to the user. Data processing system users may employ other graphics intensive applications, such as desktop publishing applications. Generally, users of these applications require and demand that the data processing systems be able to provide extremely fast graphics information.
The processing of a graphics data stream to provide a graphical display on a video display terminal requires an extremely fast graphics system to provide a display with a rapid response. In these types of graphics systems, primitives are received for processing and display. A primitive is a graphics element that is used as a building block for creating images, such as, for example, a point, a line, a triangle, a polygon, or a quadrilateral. A primitive is defined by a group of one or more vertices. A vertex defines a point, an end point of an edge, or a corner of a polygon where two edges meet. Data also is associated with a vertex in which the data includes information, such as positional coordinates, colors, normals, and texture coordinates. Commands are sent to the graphics system to define how the primitives and other data should be processed for display.
Typical graphics implementations offer two types of xe2x80x9cviewsxe2x80x9d. One is orthographic, in which all parallel lines appear parallel on the screen, lending a somewhat unreal flavor to the scene. The xe2x80x9cperspectivexe2x80x9d view is often preferred, because it more closely mimics what the viewer would see if viewing the object through a real xe2x80x9cwindowxe2x80x9d. In this view, there is a xe2x80x9cnear planexe2x80x9d and a xe2x80x9cfar planexe2x80x9d each at a certain distance from the viewpoint. These distances are referred to as xe2x80x9cznearxe2x80x9d and xe2x80x9czfarxe2x80x9d respectively. This perspective view involves the non-trivial use of four-dimensional coordinates, to help xe2x80x9cwarpxe2x80x9d the viewing frustum into a cube for proper rendering. The crux of this xe2x80x9cwarpxe2x80x9d operation is the act of dividing the x, y, and z coordinates by the xe2x80x9cwxe2x80x9d coordinate. Most implementations of perspective transformations compute 1/w and then multiply by this number three times, meaning that only one expensive divide operation needs to be done. The floating point divide operation, however, remains a very complex task, using anywhere from 20 to 80 cycles of processor resources per vertex.
Therefore, it would be advantageous to have an improved method and apparatus for performing perspective transformations.
The present invention provides a method and apparatus in a data processing system for processing perspective transformations. An estimate of a depth coordinate is obtained. A determination is made as to whether the estimate is sufficiently accurate for the perspective transformation. An algebraic operation is performed on the estimate if the estimate is insufficiently accurate for the perspective transformation, wherein the algebraic operation increases the accuracy of the estimate.